/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Fahmi
 */
public class MacamDistribusi implements KalkulatorStatistik{
    
    Distribusi distribusi;
    
    public MacamDistribusi(String tipe){
    
        if(tipe.equalsIgnoreCase("Normal"))
            distribusi=new Normal();
        else if(tipe.equalsIgnoreCase("Gamma"))
            distribusi=new Gamma();
        else if(tipe.equalsIgnoreCase("Uniform"))
            distribusi=new Uniform();
        else if(tipe.equalsIgnoreCase("Chi-Square"))
            distribusi=new ChiSquare();
        else if(tipe.equalsIgnoreCase("Fisher"))
            distribusi=new Fisher();    
        else if(tipe.equalsIgnoreCase("Student-t"))
            distribusi=new StudentT();
        else if(tipe.equalsIgnoreCase("Eksponensial"))
            distribusi=new Eksponensial();    
        else{ 
            System.out.println("Anda salah memasukkan tipe distribusi, \n "
                +" disini hanya melayani Normal, Gamma, Uniform, Chi-Square, Fisher, Student-t, dan Eksponensial");
            System.exit(0);
        }
        
    }
    
    @Override
    public void userInput(){
        distribusi.pengertian();
        distribusi.input();
    }
    
    @Override
    public void output(){
        distribusi.pdf();
        distribusi.mean();    
        distribusi.varians();
        distribusi.standarDeviasi();
        System.out.println("\n");
    }

    @Override
    public void userInput(InputOutput in) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
